﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace ZhimeiSoft.CharmManager.DOL
{
    /// <summary>
    /// 提醒表
    /// </summary>
    public class DBEntityTimeCall : DBEntityBase
    {
        /// <summary>
        /// 提醒表
        /// </summary>
        /// <returns></returns>
        public override string GetTableName()
        {
            return "TIMECALL";
        }

        public DBEntityTimeCall()
            : base()
        {
        }
            
        public DBEntityTimeCall(DataRow drRow)
        {
            this.TIMECALLID = Convert.ToInt32(drRow[DBEntityTimeCall.FieldName.TIMECALLID]);
            this.TDESCRIPTION = Convert.ToString(drRow[DBEntityTimeCall.FieldName.TDESCRIPTION].ToString());
            this.TSTARTCALLTIME = Convert.ToDateTime(drRow[DBEntityTimeCall.FieldName.TSTARTCALLTIME]);
            this.TPLANSTARTTIME = Convert.ToDateTime(drRow[DBEntityTimeCall.FieldName.TPLANSTARTTIME]);
            this.TPLANENDTIME = Convert.ToDateTime(drRow[DBEntityTimeCall.FieldName.TPLANENDTIME]);
            this.TPLANTIMETYPE = drRow[DBEntityTimeCall.FieldName.TPLANTIMETYPE].ToString();
            this.TCALLMEMO = drRow[DBEntityTimeCall.FieldName.TCALLMEMO].ToString();
            this.EMPLOYEEID = Convert.ToInt32(drRow[DBEntityTimeCall.FieldName.EMPLOYEEID]);
            this.SALONID = Convert.ToInt32(drRow[DBEntityTimeCall.FieldName.SALONID]);
        }
        /// <summary>
        /// 提醒ID
        /// </summary>
        public int TIMECALLID { get; set; }
        /// <summary>
        /// 提醒说明
        /// </summary>
        public string TDESCRIPTION { get; set; }
        /// <summary>
        /// 提醒第一次的开始时间
        /// </summary>
        public DateTime TSTARTCALLTIME { get; set; }
        /// <summary>
        /// 提醒计划开始时间
        /// </summary>
        public DateTime TPLANSTARTTIME { get; set; }
        /// <summary>
        /// 提醒计划结束时间
        /// </summary>
        public DateTime TPLANENDTIME { get; set; }
        /// <summary>
        /// 提醒类型该类型只能在TOP 状态有效，SH每小时提醒 SD 每天提醒 SW 每周提醒 SM 每月提醒 SDH 定时提醒
        /// </summary>
        public string TPLANTIMETYPE { get; set; }
        /// <summary>
        /// 提醒状态 开始提醒 TST  提醒计划已经完成 TEN
        /// </summary>
        public string TPLANTIMESTATE { get; set; }
        /// <summary>
        /// 说明
        /// </summary>
        public string TCALLMEMO { get; set; }
        /// <summary>
        /// 员工ID
        /// </summary>
        public int EMPLOYEEID { get; set; }
        /// <summary>
        /// 店ID
        /// </summary>
        public int SALONID { get; set; }
        /// <summary>
        /// 字段名称
        /// </summary>
        public static class FieldName
        {
            /// <summary>
            /// 提醒ID
            /// </summary>
            public const string TIMECALLID = "TIMECALLID";
            /// <summary>
            /// 提醒说明
            /// </summary>
            public const string TDESCRIPTION = "TDESCRIPTION";
            /// <summary>
            /// 提醒第一次的开始时间
            /// </summary>
            public const string TSTARTCALLTIME = "TSTARTCALLTIME";
            /// <summary>
            /// 提醒计划开始时间
            /// </summary>
            public const string TPLANSTARTTIME = "TPLANSTARTTIME";
            /// <summary>
            /// 提醒计划结束时间
            /// </summary>
            public const string TPLANENDTIME = "TPLANENDTIME";
            /// <summary>
            /// 提醒类型该类型 SH每小时提醒 SD 每天提醒 SW 每周提醒 SM 每月提醒 SDH 定时提醒
            /// </summary>
            public const string TPLANTIMETYPE = "TPLANTIMETYPE";
            /// <summary>
            /// 提醒状态 开始提醒 T0S  提醒完成 T0E
            /// </summary>
            public const string TPLANTIMESTATE = "TPLANTIMESTATE";
            /// <summary>
            /// 说明
            /// </summary>
            public const string TCALLMEMO = "TCALLMEMO";
            /// <summary>
            /// 员工ID
            /// </summary>
            public const string EMPLOYEEID = "EMPLOYEEID";
            /// <summary>
            /// 店ID
            /// </summary>
            public const string SALONID = "SALONID";
        }
        /// <summary>
        /// 提醒类型该类型
        /// </summary>
        public static class ENUM_TPLANTIMETYPE
        {
            /// <summary>
            /// SH每小时提醒 
            /// </summary>
            public const string SH = "SH";
            /// <summary>
            /// SD 每天提醒 
            /// </summary>
            public const string SD = "SD";
            /// <summary>
            /// SW 每周提醒 
            /// </summary>
            public const string SW = "SW";
            /// <summary>
            /// SM 每月提醒 
            /// </summary>
            public const string SM = "SM";
            /// <summary>
            /// SDH 定时提醒
            /// </summary>
            public const string SDH = "SDH";
            /// <summary>
            /// SH每小时提醒
            /// </summary>
            public const string SH_CHINESE = "每小时提醒";
            /// <summary>
            /// SD 每天提醒
            /// </summary>
            public const string SD_CHINESE = "每天提醒";
            /// <summary>
            /// SW 每周提醒 
            /// </summary>
            public const string SW_CHINESE = "每周提醒";
            /// <summary>
            /// SM 每月提醒 
            /// </summary>
            public const string SM_CHINESE = "每月提醒";
            /// <summary>
            /// SDH 定时提醒
            /// </summary>
            public const string SDH_CHINESE = "定时提醒";
            /// <summary>
            /// 根据枚举值返回中文
            /// </summary>
            /// <param name="cState">枚举值</param>
            /// <returns>返回中文</returns>
            public static string EnumStrToChineseStr(string cState)
            {
                string[] serchStr = new string[] { SH, SD, SW, SM, SDH };
                string[] sReturnStr = new string[] { SH_CHINESE, SD_CHINESE, SW_CHINESE, SM_CHINESE, SDH_CHINESE };
                return DBEntityBase.GetStrReturnStr(cState, serchStr, sReturnStr);
            }
            /// <summary>
            /// 根据中文返回枚举值
            /// </summary>
            /// <param name="chineseStr">中文</param>
            /// <returns>返回枚举字符串</returns>
            public static string ChineseStrToEnumStr(string chineseStr)
            {
                string[] serchStr = new string[] { SH_CHINESE, SD_CHINESE, SW_CHINESE, SM_CHINESE, SDH_CHINESE };
                string[] sReturnStr = new string[] { SH, SD, SW, SM, SDH };
                return DBEntityBase.GetStrReturnStr(chineseStr, serchStr, sReturnStr);
            }

        }
        /// <summary>
        /// 提醒状态
        /// </summary>
        public static class ENUM_TPLANTIMESTATE
        {
            /// <summary>
            /// 开始提醒 T0S
            /// </summary>
            public const string T0S = "T0S";
            /// <summary>
            /// 已经完成 T0E
            /// </summary>
            public const string T0E = "T0E";

            /// <summary>
            /// 开始提醒 T0S
            /// </summary>
            public const string T0S_CHINESE = "开始提醒";
            /// <summary>
            /// 提醒完成 T0E
            /// </summary>
            public const string T0E_CHINESE = "提醒完成";
            /// <summary>
            /// 根据枚举值返回中文
            /// </summary>
            /// <param name="cState">枚举值</param>
            /// <returns>返回中文</returns>
            public static string EnumStrToChineseStr(string cState)
            {
                string[] serchStr = new string[] { T0S, T0E };
                string[] sReturnStr = new string[] { T0S_CHINESE, T0E_CHINESE};
                return DBEntityBase.GetStrReturnStr(cState, serchStr, sReturnStr);
            }
            /// <summary>
            /// 根据中文返回枚举值
            /// </summary>
            /// <param name="chineseStr">中文</param>
            /// <returns>返回枚举字符串</returns>
            public static string ChineseStrToEnumStr(string chineseStr)
            {
                string[] serchStr = new string[] { T0S_CHINESE, T0E_CHINESE };
                string[] sReturnStr = new string[] { T0S, T0E }; 
                return DBEntityBase.GetStrReturnStr(chineseStr, serchStr, sReturnStr);
            }
        }
    }
}
